package com.yowasa.xiuxian.engine.battle.strategy;

import com.yowasa.xiuxian.annoations.BS;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.service.helper.BattleHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;

@BS(name = "术法攻击", upAbility = 0, needTravel = 0)
@Order()
public class BaseSpellStrategy extends CalAbility implements AttackStrategy {
    @Autowired
    private BattleHelper battleHelper;

    @Override
    public void action(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int atk = first.getBattleInfo().getSpell();
        int def = second.getBattleInfo().getRes();
        int dmg = battleHelper.calAtk(atk, def);
        battleHelper.autoAction(this, first, second, content, dmg, "术法");
    }

    @Override
    public boolean check(UserBattleContent user, BattleContent content) {
        return true;
    }

    @Override
    public void limit(UserBO user) {
        return;
    }

    @Override
    public String limitDesc() {
        return "无";
    }


    @Override
    public String desc() {
        return "使用术法进行攻击,攻击受自己的术法攻击力加成,计算对方术法防御";
    }

    @Override
    public ElementEnum getElement() {
        return null;
    }
}
